function loginSingle() {
  btn.onclick = function () {
    window.location.href = `./register.html`
  }

  if (getCookie(`repeat`) == 1) {
    sp1.innerText = `*密码错误请重新输入`
  }

  user.onkeyup = () => {
    deleteCookie(`repeat`)
    sp1.innerText = ``
  }
}

function regiseterSingle() {
  psw2.onkeyup = debounce(function () {
    if (psw1.value !== psw2.value) {
      btn.disabled = true
      sp1.innerText = `*两次输入的密码不一致`
      sp2.innerText = `*两次输入的密码不一致`
    } else {
      btn.disabled = false
      sp1.innerText = ``
      sp2.innerText = ``
    }
  }, 3000)

  psw1.onkeyup = debounce(function () {
    if (psw1.value !== psw2.value) {
      btn.disabled = true
      sp1.innerText = `*两次输入的密码不一致`
      sp2.innerText = `*两次输入的密码不一致`
    } else {
      btn.disabled = false
      sp1.innerText = ``
      sp2.innerText = ``
    }
  }, 3000)

  if (getCookie(`repeat`) == 1) {
    sp3.innerText = `*账号重复，请重新输入`
  }
  btn2.onclick = function () {
    window.location.href = `./login.html`
  }

  user.onkeyup = function () {
    deleteCookie(`repeat`)
    sp3.innerText = ``
  }

}